@nebutra/ui 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/components/index.d.ts +380 -0
  2. package/dist/components/index.js +2398 -0
  3. package/dist/components/index.js.map +1 -0
  4. package/dist/hooks/index.d.ts +106 -0
  5. package/dist/hooks/index.js +182 -0
  6. package/dist/hooks/index.js.map +1 -0
  7. package/dist/icons/index.d.ts +3 -0
  8. package/dist/icons/index.js +5 -0
  9. package/dist/icons/index.js.map +1 -0
  10. package/dist/index.d.ts +5 -0
  11. package/dist/index.js +31 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/layout/index.d.ts +296 -0
  14. package/dist/layout/index.js +1303 -0
  15. package/dist/layout/index.js.map +1 -0
  16. package/dist/layouts/index.d.ts +161 -0
  17. package/dist/layouts/index.js +611 -0
  18. package/dist/layouts/index.js.map +1 -0
  19. package/dist/patterns/index.d.ts +363 -0
  20. package/dist/patterns/index.js +3004 -0
  21. package/dist/patterns/index.js.map +1 -0
  22. package/dist/primitives/index.d.ts +9588 -0
  23. package/dist/primitives/index.js +26779 -0
  24. package/dist/primitives/index.js.map +1 -0
  25. package/dist/styles/brand-override.css +61 -0
  26. package/dist/tailwind.preset.d.ts +251 -0
  27. package/dist/tailwind.preset.js +273 -0
  28. package/dist/tailwind.preset.js.map +1 -0
  29. package/dist/theme/index.d.ts +150 -0
  30. package/dist/theme/index.js +28 -0
  31. package/dist/theme/index.js.map +1 -0
  32. package/dist/typography/fonts.css +110 -0
  33. package/dist/typography/index.d.ts +425 -0
  34. package/dist/typography/index.js +374 -0
  35. package/dist/typography/index.js.map +1 -0
  36. package/dist/utils/index.d.ts +61 -0
  37. package/dist/utils/index.js +55 -0
  38. package/dist/utils/index.js.map +1 -0
  39. package/package.json +18 -8
@@ -0,0 +1,380 @@
1
+ export { ActionIcon, ActionIconGroup, Alert, Avatar, Button, Checkbox, DraggablePanel, DraggablePanelBody, DraggablePanelContainer, DraggablePanelFooter, DraggablePanelHeader, Flexbox, FlexboxProps, Form, FormGroup, FormItem, Highlighter, Image, Input, List, Markdown, Menu, Modal, SearchBar, Segmented, Select, SideNav, Tag, TextArea, Tooltip } from '@lobehub/ui';
2
+ export { Spotlight } from '@lobehub/ui/awesome';
3
+ export { ChatInputArea, ChatItem, ChatItemProps, ChatList, ChatListProps, ChatMessage, MessageInput, MessageModal } from '@lobehub/ui/chat';
4
+ import * as React from 'react';
5
+ import React__default, { ReactNode } from 'react';
6
+ import * as react_jsx_runtime from 'react/jsx-runtime';
7
+ import { GraphEdge, GraphNode, Graph } from '@nebutra/graph-model';
8
+
9
+ interface PromptInputBoxProps {
10
+ onSend?: (message: string, files?: File[]) => void;
11
+ isLoading?: boolean;
12
+ placeholder?: string;
13
+ className?: string;
14
+ }
15
+ declare const PromptInputBox: React__default.ForwardRefExoticComponent<PromptInputBoxProps & React__default.RefAttributes<HTMLDivElement>>;
16
+
17
+ declare const PRESETS: {
18
+ readonly emerge: {
19
+ readonly initial: {
20
+ readonly opacity: 0;
21
+ readonly y: 16;
22
+ readonly filter: "blur(6px)";
23
+ };
24
+ readonly animate: {
25
+ readonly opacity: 1;
26
+ readonly y: 0;
27
+ readonly filter: "blur(0px)";
28
+ };
29
+ readonly exit: {
30
+ readonly opacity: 0;
31
+ readonly y: -8;
32
+ readonly filter: "blur(4px)";
33
+ };
34
+ readonly transition: {
35
+ readonly duration: 0.5;
36
+ readonly ease: readonly [0.16, 1, 0.3, 1];
37
+ };
38
+ };
39
+ readonly flow: {
40
+ readonly initial: {
41
+ readonly opacity: 0;
42
+ readonly x: -20;
43
+ };
44
+ readonly animate: {
45
+ readonly opacity: 1;
46
+ readonly x: 0;
47
+ };
48
+ readonly exit: {
49
+ readonly opacity: 0;
50
+ readonly x: 20;
51
+ };
52
+ readonly transition: {
53
+ readonly duration: 0.3;
54
+ readonly ease: readonly [0, 0, 0.2, 1];
55
+ };
56
+ };
57
+ readonly fade: {
58
+ readonly initial: {
59
+ readonly opacity: 0;
60
+ };
61
+ readonly animate: {
62
+ readonly opacity: 1;
63
+ };
64
+ readonly exit: {
65
+ readonly opacity: 0;
66
+ };
67
+ readonly transition: {
68
+ readonly duration: 0.3;
69
+ };
70
+ };
71
+ readonly fadeUp: {
72
+ readonly initial: {
73
+ readonly opacity: 0;
74
+ readonly y: 16;
75
+ };
76
+ readonly animate: {
77
+ readonly opacity: 1;
78
+ readonly y: 0;
79
+ };
80
+ readonly exit: {
81
+ readonly opacity: 0;
82
+ readonly y: 16;
83
+ };
84
+ readonly transition: {
85
+ readonly default: {
86
+ readonly type: "spring";
87
+ readonly stiffness: 200;
88
+ readonly damping: 24;
89
+ readonly mass: 1;
90
+ };
91
+ readonly bouncy: {
92
+ readonly type: "spring";
93
+ readonly stiffness: 300;
94
+ readonly damping: 15;
95
+ readonly mass: 0.8;
96
+ };
97
+ readonly heavy: {
98
+ readonly type: "spring";
99
+ readonly stiffness: 120;
100
+ readonly damping: 28;
101
+ readonly mass: 1.5;
102
+ };
103
+ readonly gentle: {
104
+ readonly type: "spring";
105
+ readonly stiffness: 80;
106
+ readonly damping: 20;
107
+ readonly mass: 1;
108
+ };
109
+ };
110
+ };
111
+ readonly scale: {
112
+ readonly initial: {
113
+ readonly opacity: 0;
114
+ readonly scale: 0.95;
115
+ };
116
+ readonly animate: {
117
+ readonly opacity: 1;
118
+ readonly scale: 1;
119
+ };
120
+ readonly exit: {
121
+ readonly opacity: 0;
122
+ readonly scale: 0.95;
123
+ };
124
+ readonly transition: {
125
+ readonly default: {
126
+ readonly type: "spring";
127
+ readonly stiffness: 200;
128
+ readonly damping: 24;
129
+ readonly mass: 1;
130
+ };
131
+ readonly bouncy: {
132
+ readonly type: "spring";
133
+ readonly stiffness: 300;
134
+ readonly damping: 15;
135
+ readonly mass: 0.8;
136
+ };
137
+ readonly heavy: {
138
+ readonly type: "spring";
139
+ readonly stiffness: 120;
140
+ readonly damping: 28;
141
+ readonly mass: 1.5;
142
+ };
143
+ readonly gentle: {
144
+ readonly type: "spring";
145
+ readonly stiffness: 80;
146
+ readonly damping: 20;
147
+ readonly mass: 1;
148
+ };
149
+ };
150
+ };
151
+ };
152
+ type Preset = keyof typeof PRESETS;
153
+ declare const STAGGER: {
154
+ readonly fast: 0.05;
155
+ readonly normal: 0.1;
156
+ readonly slow: 0.2;
157
+ };
158
+ interface AnimateInProps {
159
+ children: React.ReactNode;
160
+ preset?: Preset;
161
+ delay?: number;
162
+ duration?: number;
163
+ inView?: boolean;
164
+ className?: string;
165
+ }
166
+ declare function AnimateIn(props: AnimateInProps): react_jsx_runtime.JSX.Element;
167
+ interface AnimateInGroupProps {
168
+ children: React.ReactNode;
169
+ stagger?: keyof typeof STAGGER;
170
+ inView?: boolean;
171
+ className?: string;
172
+ }
173
+ declare function AnimateInGroup(props: AnimateInGroupProps): react_jsx_runtime.JSX.Element;
174
+
175
+ interface AsciiTextProps {
176
+ text: string;
177
+ className?: string;
178
+ font?: any;
179
+ }
180
+ declare function AsciiText({ text, className, font }: AsciiTextProps): react_jsx_runtime.JSX.Element;
181
+
182
+ interface ChangelogEntry {
183
+ version: string;
184
+ title: string;
185
+ date: string;
186
+ tag?: string;
187
+ tagColor?: string;
188
+ excerpt: string;
189
+ url: string;
190
+ }
191
+ interface ChangelogWidgetProps {
192
+ entries: ChangelogEntry[];
193
+ changelogUrl?: string;
194
+ className?: string;
195
+ }
196
+ declare function ChangelogWidget({ entries, changelogUrl, className, }: ChangelogWidgetProps): react_jsx_runtime.JSX.Element;
197
+
198
+ /**
199
+ * Pure mapping layer between a neutral `@nebutra/graph-model` graph and the
200
+ * `@xyflow/react` view model. Framework-free on purpose: no React, no DOM,
201
+ * no domain types — every function is a referentially-transparent transform,
202
+ * generic over the caller's node/edge specialization.
203
+ *
204
+ * Domain knowledge (how to build an edge from a connection, an edge's stable
205
+ * identity) is INJECTED, so this library never depends on `@nebutra/reel` or
206
+ * any feature package. The graph is the source of truth; xyflow shapes are
207
+ * derived; gestures are translated back into a *new* immutable graph with all
208
+ * non-structural fields preserved.
209
+ */
210
+
211
+ /** Stable, collision-free identity for an edge (injected per domain). */
212
+ type EdgeIdentity<E extends GraphEdge> = (edge: E) => string;
213
+ /** Build a domain edge from an xyflow connection, or reject it (null). */
214
+ type MakeEdge<E extends GraphEdge> = (from: string, to: string, targetHandle: string | null) => E | null;
215
+ /** xyflow's connection payload (source/target may be null mid-drag). */
216
+ interface FlowConnection {
217
+ source: string | null;
218
+ target: string | null;
219
+ sourceHandle: string | null;
220
+ targetHandle: string | null;
221
+ }
222
+
223
+ /** Domain-supplied presentation for one node. */
224
+ interface NodeView {
225
+ readonly label: string;
226
+ readonly subtitle?: string;
227
+ readonly icon?: ReactNode;
228
+ /** Drives the accent border (e.g. "has produced output"). */
229
+ readonly ready?: boolean;
230
+ }
231
+ interface NodeGraphCanvasProps<N extends GraphNode, E extends GraphEdge, G extends Graph<N, E>> {
232
+ /** The graph to render. Treated as the single source of truth. */
233
+ readonly graph: G;
234
+ /** Called with a new immutable graph after every accepted mutation. */
235
+ readonly onChange: (next: G) => void;
236
+ /** Stable identity for an edge (also used for dedupe + removal). */
237
+ readonly edgeIdentity: EdgeIdentity<E>;
238
+ /** Build a domain edge from a connection, or veto it (return null). */
239
+ readonly makeEdge: MakeEdge<E>;
240
+ /** Map a node to its visual presentation. */
241
+ readonly renderNode: (node: N) => NodeView;
242
+ /** When true, the canvas is view/pan/zoom only — no edits. */
243
+ readonly readOnly?: boolean;
244
+ /** Optional extra class on the outer container. */
245
+ readonly className?: string;
246
+ }
247
+ declare function NodeGraphCanvas<N extends GraphNode, E extends GraphEdge, G extends Graph<N, E>>({ graph, onChange, edgeIdentity, makeEdge, renderNode, readOnly, className, }: NodeGraphCanvasProps<N, E, G>): react_jsx_runtime.JSX.Element;
248
+
249
+ interface ChecklistItem {
250
+ /** Unique identifier for the item */
251
+ id: number | string;
252
+ /** Main text content */
253
+ text: string;
254
+ /** Optional helper text displayed below */
255
+ helperText?: string;
256
+ /** Optional link displayed after helper text */
257
+ helperLink?: {
258
+ href: string;
259
+ text: string;
260
+ };
261
+ }
262
+ interface OnboardingChecklistProps {
263
+ /** Main heading for the checklist */
264
+ title: string;
265
+ /** Description displayed below the title */
266
+ description: string;
267
+ /** Array of checklist items to display */
268
+ items: ChecklistItem[];
269
+ /** URL for the video thumbnail image */
270
+ videoThumbnailUrl: string;
271
+ /** Embed URL for the video (YouTube, Vimeo, etc.) */
272
+ videoUrl: string;
273
+ /** Additional CSS classes */
274
+ className?: string;
275
+ }
276
+ /**
277
+ * OnboardingChecklist - Animated checklist with video guide
278
+ *
279
+ * @description
280
+ * A responsive onboarding component that displays a checklist of items
281
+ * alongside a video thumbnail that opens in a modal dialog.
282
+ *
283
+ * @example Basic usage
284
+ * ```tsx
285
+ * <OnboardingChecklist
286
+ * title="Get Started"
287
+ * description="Complete these steps to set up your account"
288
+ * items={[
289
+ * { id: 1, text: "Create your profile" },
290
+ * { id: 2, text: "Add your first project" },
291
+ * {
292
+ * id: 3,
293
+ * text: "Invite team members",
294
+ * helperText: "Need help?",
295
+ * helperLink: { href: "/docs", text: "Read the guide" }
296
+ * },
297
+ * ]}
298
+ * videoThumbnailUrl="https://example.com/thumbnail.jpg"
299
+ * videoUrl="https://youtube.com/embed/xxx"
300
+ * />
301
+ * ```
302
+ */
303
+ declare function OnboardingChecklist({ title, description, items, videoThumbnailUrl, videoUrl, className, }: OnboardingChecklistProps): react_jsx_runtime.JSX.Element;
304
+
305
+ interface ChatSender {
306
+ /** Display name */
307
+ name: string;
308
+ /** Avatar URL */
309
+ avatar: string;
310
+ /** Online status */
311
+ isOnline: boolean;
312
+ }
313
+ interface ChatReaction {
314
+ /** Emoji character */
315
+ emoji: string;
316
+ /** Number of reactions */
317
+ count: number;
318
+ /** Whether current user has reacted */
319
+ reacted: boolean;
320
+ }
321
+ interface ChatMessage {
322
+ /** Unique message identifier */
323
+ id: string;
324
+ /** Message text content */
325
+ content: string;
326
+ /** Sender information */
327
+ sender: ChatSender;
328
+ /** Display timestamp */
329
+ timestamp: string;
330
+ /** Delivery status */
331
+ status: "sent" | "delivered" | "read";
332
+ /** Optional reactions */
333
+ reactions?: ChatReaction[];
334
+ }
335
+ interface TeamChatProps {
336
+ /** Chat/channel name */
337
+ chatName: string;
338
+ /** Optional tagline under the name */
339
+ tagline?: string;
340
+ /** Array of messages to display */
341
+ messages: ChatMessage[];
342
+ /** Placeholder text for input */
343
+ inputPlaceholder?: string;
344
+ /** Callback when send button clicked */
345
+ onSendMessage?: (message: string) => void;
346
+ /** Callback when reaction clicked */
347
+ onReactionClick?: (messageId: string, emoji: string) => void;
348
+ /** Callback when more options clicked */
349
+ onMoreOptions?: () => void;
350
+ /** Additional CSS classes */
351
+ className?: string;
352
+ }
353
+ /**
354
+ * TeamChat - Team messaging interface with participant sidebar
355
+ *
356
+ * @description
357
+ * A full-featured team chat UI component with participant list,
358
+ * message display with reactions, and message input.
359
+ *
360
+ * @example
361
+ * ```tsx
362
+ * <TeamChat
363
+ * chatName="Engineering Team"
364
+ * tagline="Ship fast, ship often"
365
+ * messages={[
366
+ * {
367
+ * id: "1",
368
+ * content: "Hey team! Ready for standup?",
369
+ * sender: { name: "Alice", avatar: "/alice.jpg", isOnline: true },
370
+ * timestamp: "10:00 AM",
371
+ * status: "read",
372
+ * },
373
+ * ]}
374
+ * onSendMessage={(msg) => console.log(msg)}
375
+ * />
376
+ * ```
377
+ */
378
+ declare function TeamChat({ chatName, tagline, messages, inputPlaceholder, onSendMessage, onReactionClick, onMoreOptions, className, }: TeamChatProps): react_jsx_runtime.JSX.Element;
379
+
380
+ export { AnimateIn, AnimateInGroup, type AnimateInGroupProps, type AnimateInProps, AsciiText, type ChangelogEntry, ChangelogWidget, type ChangelogWidgetProps, type ChatReaction, type ChatSender, type ChecklistItem, type EdgeIdentity, type FlowConnection, type MakeEdge, NodeGraphCanvas, type NodeGraphCanvasProps, type NodeView, OnboardingChecklist, type OnboardingChecklistProps, PromptInputBox, TeamChat, type TeamChatProps };